# istruzioni per stampare grafici relativi ad IXP singoli


# 0) istruzioni generali:

set terminal jpeg enhanced linewidth 2
set xtics nomirror out autofreq
set ytics nomirror out autofreq
set border 3
set grid
unset key
unset logscale
unset xlabel

# directory in cui salvare i grafici
path = "./individual/"


# 1) istogrammi che mettono a confronto i continenti mediante varie metriche:

set style data histogram
set xtics rotate by 270 offset 0,0

# 1.1) numero di membri pubblici
#
set title "# of Members in IXPs"
set output path."ind_ixp_member.jpg"
set ylabel "# Members"
plot '../C++/Result/gnuplot/gnuplot_ixp_custom.txt' using 3:xticlabels(29)

# 1.2) numero di peering
#
set title "# of Peerings in IXPs"
set output path."ind_ixp_peering.jpg"
set ylabel "# Peerings"
plot '../C++/Result/gnuplot/gnuplot_ixp_custom.txt' using 5:xticlabels(29)

# 1.3) link density
#
set title "IXP Link Density"
set output path."ind_ixp_link_density.jpg"
set ylabel "Link Density"
plot '../C++/Result/gnuplot/gnuplot_ixp_custom.txt' using 12:xticlabels(29)

# 1.4) out degree fraction
#
set title "AVG AS ODF"
set output path."ind_ixp_odf.jpg"
set ylabel "ODF"
plot '../C++/Result/gnuplot/gnuplot_ixp_custom.txt' using 20:xticlabels(29)


# 2) shell index ccdf

set style data lines
set key
set xlabel "Shell Index Value"
set ylabel "CCDF"
set xtics norotate nooffset
titolo = "Shell Index CCDF of "

# 2.1) ccdf degli ixp europei considerati
#
set title titolo."European IXPs"
set output path."ind_siccdf_EU.jpg"
set xtics 5
plot	'../C++/Result/gnuplot/gnuplot_siccdf_13_0.txt' t "(13) LINX", \
		'../C++/Result/gnuplot/gnuplot_siccdf_19_0.txt' t "(19) AMS-IX", \
		'../C++/Result/gnuplot/gnuplot_siccdf_22_0.txt' t "(22) DE-CIX", \
		'../C++/Result/gnuplot/gnuplot_siccdf_25_0.txt' t "(25) MIX"


# 2.2) ccdf degli ixp africani considerati
#
set title titolo."Afican IXPs"
set output path."ind_siccdf_AF.jpg"
set xtics 1
plot	'../C++/Result/gnuplot/gnuplot_siccdf_122_0.txt' t "(122) KIXP", \
		'../C++/Result/gnuplot/gnuplot_siccdf_184_0.txt' t "(184) IXPN"

# 2.3) ccdf degli ixp asiatici considerati
#
set title titolo."Asian IXPs"
set output path."ind_siccdf_AS.jpg"
set xtics 1
plot	'../C++/Result/gnuplot/gnuplot_siccdf_21_0.txt' t "(21) JPIX"

# 2.4) ccdf degli ixp sud americani considerati
#
set title titolo."Latin American IXPs"
set output path."ind_siccdf_LA.jpg"
set xtics 2
plot	'../C++/Result/gnuplot/gnuplot_siccdf_90_0.txt' t "(90) PTTMetro-Porto-Alegre"

# 2.5) ccdf degli ixp nord americani considerati
#
set title titolo."North American IXPs"
set output path."ind_siccdf_NA.jpg"
set xtics 5
plot	 [0:55] '../C++/Result/gnuplot/gnuplot_siccdf_10_0.txt' t "(10) SIX", \
		'../C++/Result/gnuplot/gnuplot_siccdf_17_0.txt' t "(17) TorIX", \
		'../C++/Result/gnuplot/gnuplot_siccdf_11_0.txt' t "(11) NYIIX", \
		'../C++/Result/gnuplot/gnuplot_siccdf_185_0.txt' t "(185) Any2-Reston"

# 2.6) ccdf degli ixp dell'Oceania considerati
#
set title titolo."Oceanian IXPs"
set output path."ind_siccdf_OC.jpg"
set xtics 1
plot	'../C++/Result/gnuplot/gnuplot_siccdf_64_0.txt' t "(64) APE", \
		'../C++/Result/gnuplot/gnuplot_siccdf_155_0.txt' t "(155) WIX"

# 2.7) ccdf del "peggior" ixp europeo e del "miglior" ixp non europeo
#
set title "Shell Index CCDF: worst EU vs best non EU"
set output path."ind_siccdf_EU_nonEU.jpg"
set xtics 5
plot	'../C++/Result/gnuplot/gnuplot_siccdf_13_0.txt' t "(13) LINX", \
		'../C++/Result/gnuplot/gnuplot_siccdf_11_0.txt' t "(11) NYIIX"

# 2.8) ccdf degli ixp europei considerati che hanno RS togliendo il RS
#
set title titolo."European IXPs (no RS)"
set output path."ind_siccdf_EU_nors.jpg"
set xtics 5
plot	'../C++/Result/gnuplot/gnuplot_siccdf_13_1.txt' t "(13) LINX", \
		'../C++/Result/gnuplot/gnuplot_siccdf_19_1.txt' t "(19) AMS-IX", \
		'../C++/Result/gnuplot/gnuplot_siccdf_22_1.txt' t "(22) DE-CIX", \
		'../C++/Result/gnuplot/gnuplot_siccdf_25_1.txt' t "(25) MIX"

# 2.9) ccdf degli ixp africani considerati che hanno RS togliendo il RS
#
set title titolo."Afican IXPs (no RS)"
set output path."ind_siccdf_AF_nors.jpg"
set xtics 1
plot	'../C++/Result/gnuplot/gnuplot_siccdf_122_1.txt' t "(122) KIXP"

# 2.10) ccdf degli ixp dell'Oceania considerati che hanno RS togliendo il RS
#
set title titolo."Oceanian IXPs (no RS)"
set output path."ind_siccdf_OC_nors.jpg"
set xtics 1
plot	'../C++/Result/gnuplot/gnuplot_siccdf_64_1.txt' t "(64) APE", \
		'../C++/Result/gnuplot/gnuplot_siccdf_155_1.txt' t "(155) WIX"

# 2.11) ccdf del "peggior" ixp europeo e del "miglior" ixp non europeo che hanno RS togliendo il RS
#
set title "Shell Index CCDF: worst EU vs best non EU (no RS)"
set output path."ind_siccdf_EU_nonEU_nors.jpg"
set xtics 5
plot	'../C++/Result/gnuplot/gnuplot_siccdf_13_1.txt' t "(13) LINX", \
		'../C++/Result/gnuplot/gnuplot_siccdf_64_1.txt' t "(64) APE"
		
# 2.12) ccdf degli ixp europei considerati che hanno RS formando una clique fra i peer del RS
#
set title titolo."European IXPs (no RS w/ clique)"
set output path."ind_siccdf_EU_norscli.jpg"
set xtics 20
plot	'../C++/Result/gnuplot/gnuplot_siccdf_13_2.txt' t "(13) LINX", \
		'../C++/Result/gnuplot/gnuplot_siccdf_19_2.txt' t "(19) AMS-IX", \
		'../C++/Result/gnuplot/gnuplot_siccdf_22_2.txt' t "(22) DE-CIX", \
		'../C++/Result/gnuplot/gnuplot_siccdf_25_2.txt' t "(25) MIX"

# 2.13) ccdf degli ixp africani considerati che hanno RS formando una clique fra i peer del RS
#
set title titolo."Afican IXPs (no RS w/ clique)"
set output path."ind_siccdf_AF_norscli.jpg"
set xtics 1
plot	'../C++/Result/gnuplot/gnuplot_siccdf_122_2.txt' t "(122) KIXP"

# 2.14) ccdf degli ixp dell'Oceania considerati che hanno RS formando una clique fra i peer del RS
#
set title titolo."Oceanian IXPs (no RS w/ clique)"
set output path."ind_siccdf_OC_norscli.jpg"
set xtics 3
plot	'../C++/Result/gnuplot/gnuplot_siccdf_64_2.txt' t "(64) APE", \
		'../C++/Result/gnuplot/gnuplot_siccdf_155_2.txt' t "(155) WIX"

# 2.15) ccdf del "peggior" ixp europeo e del "miglior" ixp non europeo che hanno RS formando una 
#		clique fra i peer del RS
#
set title "Shell Index CCDF: worst EU vs best non EU (no RS w/ clique)"
set output path."ind_siccdf_EU_nonEU_norscli.jpg"
set xtics 5
plot	'../C++/Result/gnuplot/gnuplot_siccdf_19_2.txt' t "(19) AMS-IX", \
		'../C++/Result/gnuplot/gnuplot_siccdf_64_2.txt' t "(64) APE"


# 3) confronto fra il degree globale dell'AS con massimo degree e il degree globale dei suoi peer:

unset xtics
set xlabel "ASs Peering with Max_degree_AS" noenhanced
set ylabel "GLOBAL DEGREE"
set style data steps
set ytics autofreq

# 3.1) KIXP
#
set title "Global degree of ASs connected to Max_degree_AS (Tier 1?)\nKIXP (122)" noenhanced
set output path."ind_c2p_122.jpg"
plot 	'< sort -r -g -k2,2 ../C++/Result/gnuplot/gnuplot_as_tear_1_122_1.txt' using 2 t "AS peer", \
		'' using 3 t "Max degree AS"

# 3.2) IXPN
#
set title "Global degree of ASs connected to Max_degree_AS (Tier 1?)\nIXPN (184)" noenhanced
set output path."ind_c2p_184.jpg"
plot 	'< sort -r -g -k2,2 ../C++/Result/gnuplot/gnuplot_as_tear_1_184_1.txt' using 2 t "AS peer", \
		'' using 3 t "Max degree AS"

# 3.3) JPIX
#
set title "Global degree of ASs connected to Max_degree_AS (Tier 1?)\nJPIX (21)" noenhanced
set output path."ind_c2p_21.jpg"
plot 	'< sort -r -g -k2,2 ../C++/Result/gnuplot/gnuplot_as_tear_1_21_1.txt' using 2 t "AS peer", \
		'' using 3 t "Max degree AS"

# 3.4) LINX
#
set title "Global degree of ASs connected to Max_degree_AS (Tier 1?)\nLINX (13)" noenhanced
set output path."ind_c2p_13.jpg"
plot 	'< sort -r -g -k2,2 ../C++/Result/gnuplot/gnuplot_as_tear_1_13_1.txt' using 2 t "AS peer", \
		'' using 3 t "Max degree AS"

# 3.5) AMS-IX
#
set title "Global degree of ASs connected to Max_degree_AS (Tier 1?)\nAMS-IX (19)" noenhanced
set output path."ind_c2p_19.jpg"
plot 	'< sort -r -g -k2,2 ../C++/Result/gnuplot/gnuplot_as_tear_1_19_1.txt' using 2 t "AS peer", \
		'' using 3 t "Max degree AS"

# 3.6) DE-CIX
#
set title "Global degree of ASs connected to Max_degree_AS (Tier 1?)\nDE-CIX (22)" noenhanced
set output path."ind_c2p_22.jpg"
plot 	'< sort -r -g -k2,2 ../C++/Result/gnuplot/gnuplot_as_tear_1_22_1.txt' using 2 t "AS peer", \
		'' using 3 t "Max degree AS"

# 3.7) PTTMetro-Porto-Alegre
#
set title "Global degree of ASs connected to Max_degree_AS (Tier 1?)\nPTTMetro-Porto-Alegre (90)" noenhanced
set output path."ind_c2p_90.jpg"
plot 	'< sort -r -g -k2,2 ../C++/Result/gnuplot/gnuplot_as_tear_1_90_1.txt' using 2 t "AS peer", \
		'' using 3 t "Max degree AS"

# 3.8) SIX
#
set title "Global degree of ASs connected to Max_degree_AS (Tier 1?)\nSIX (10)" noenhanced
set output path."ind_c2p_10.jpg"
plot 	'< sort -r -g -k2,2 ../C++/Result/gnuplot/gnuplot_as_tear_1_10_1.txt' using 2 t "AS peer", \
		'' using 3 t "Max degree AS"

# 3.9) TorIX
#
set title "Global degree of ASs connected to Max_degree_AS (Tier 1?)\nToxIX (17)" noenhanced
set output path."ind_c2p_17.jpg"
plot 	'< sort -r -g -k2,2 ../C++/Result/gnuplot/gnuplot_as_tear_1_17_1.txt' using 2 t "AS peer", \
		'' using 3 t "Max degree AS"

# 3.10) NYIIX
#
set title "Global degree of ASs connected to Max_degree_AS (Tier 1?)\nNYIIX (11)" noenhanced
set output path."ind_c2p_11.jpg"
plot 	'< sort -r -g -k2,2 ../C++/Result/gnuplot/gnuplot_as_tear_1_11_1.txt' using 2 t "AS peer", \
		'' using 3 t "Max degree AS"

# 3.11) Any2-Reston
#
set title "Global degree of ASs connected to Max_degree_AS (Tier 1?)\nAny2-Reston (185)" noenhanced
set output path."ind_c2p_185.jpg"
plot 	'< sort -r -g -k2,2 ../C++/Result/gnuplot/gnuplot_as_tear_1_185_1.txt' using 2 t "AS peer", \
		'' using 3 t "Max degree AS"

# 3.12) APE
#
set title "Global degree of ASs connected to Max_degree_AS (Tier 1?)\nAPE (64)" noenhanced
set output path."ind_c2p_64.jpg"
plot 	'< sort -r -g -k2,2 ../C++/Result/gnuplot/gnuplot_as_tear_1_64_1.txt' using 2 t "AS peer", \
		'' using 3 t "Max degree AS"

# 3.13) WIX
#
set title "Global degree of ASs connected to Max_degree_AS (Tier 1?)\nWIX (155)" noenhanced
set output path."ind_c2p_155.jpg"
plot 	'< sort -r -g -k2,2 ../C++/Result/gnuplot/gnuplot_as_tear_1_155_1.txt' using 2 t "AS peer", \
		'' using 3 t "Max degree AS"

# 3.14) MIX
#
set title "Global degree of ASs connected to Max_degree_AS (Tier 1?)\nMIX (25)" noenhanced
set output path."ind_c2p_25.jpg"
plot 	'< sort -r -g -k2,2 ../C++/Result/gnuplot/gnuplot_as_tear_1_25_1.txt' using 2 t "AS peer", \
		'' using 3 t "Max degree AS"

# 4) degree ccdf

set style data lines
set key
set xlabel "Degree Value"
set ylabel "CCDF"
set xtics norotate nooffset 
set logscale x
set logscale y
titolo = "Degree CCDF of "

# 4.1) ccdf degli ixp europei considerati
#
set title titolo."European IXPs"
set output path."ind_dgccdf_EU.jpg"
set xtics 5
plot	'../C++/Result/gnuplot/gnuplot_dgccdf_13_0.txt' t "(13) LINX", \
		'../C++/Result/gnuplot/gnuplot_dgccdf_19_0.txt' t "(19) AMS-IX", \
		'../C++/Result/gnuplot/gnuplot_dgccdf_22_0.txt' t "(22) DE-CIX", \
		'../C++/Result/gnuplot/gnuplot_dgccdf_25_0.txt' t "(25) MIX"

# 4.1) ccdf degli ixp nord americani considerati
#
set title titolo."North American IXPs"
set output path."ind_dgccdf_NA.jpg"
set xtics 5
plot	'../C++/Result/gnuplot/gnuplot_dgccdf_10_0.txt' t "(10) SIX", \
		'../C++/Result/gnuplot/gnuplot_dgccdf_17_0.txt' t "(17) TorIX", \
		'../C++/Result/gnuplot/gnuplot_dgccdf_11_0.txt' t "(11) NYIIX", \
		'../C++/Result/gnuplot/gnuplot_dgccdf_185_0.txt' t "(185) Any2-Reston"


# 5) global_degree ccdf

set style data lines
set key
set xlabel "Global Degree Value"
set ylabel "CCDF"
set xtics norotate nooffset 
set logscale x
set logscale y
titolo = "Global Degree CCDF of "

# 5.1) ccdf degli ixp europei considerati
#
set title titolo."European IXPs"
set output path."ind_global_dgccdf_EU.jpg"
set xtics 5
plot	'../C++/Result/gnuplot/gnuplot_global_dgccdf_13_0.txt' t "(13) LINX", \
		'../C++/Result/gnuplot/gnuplot_global_dgccdf_19_0.txt' t "(19) AMS-IX", \
		'../C++/Result/gnuplot/gnuplot_global_dgccdf_22_0.txt' t "(22) DE-CIX", \
		'../C++/Result/gnuplot/gnuplot_global_dgccdf_25_0.txt' t "(25) MIX"

# 5.1) ccdf degli ixp nord americani considerati
#
set title titolo."North American IXPs"
set output path."ind_global_dgccdf_NA.jpg"
set xtics 5
plot	'../C++/Result/gnuplot/gnuplot_global_dgccdf_10_0.txt' t "(10) SIX", \
		'../C++/Result/gnuplot/gnuplot_global_dgccdf_17_0.txt' t "(17) TorIX", \
		'../C++/Result/gnuplot/gnuplot_global_dgccdf_11_0.txt' t "(11) NYIIX", \
		'../C++/Result/gnuplot/gnuplot_global_dgccdf_185_0.txt' t "(185) Any2-Reston"



